Ruby Hex
hex also implemented in
Python
The goal in hex is simple. Red moves first, and each player alternates placing stones anywhere
on the board. Red tries to form an unbroken chain of stones between top and bottom, blue
between left and right. The first player to achieve an unbroken chain wins. Ties are
mathematically impossible. While the rules are simple, the strategy is
complex.
I have implemented an internet two-player hex game in the
Ruby
programming language. It uses
Jabber, an open XML-based messaging system.
Several steps are needed to set up this program:
- Download a
Jabber client,
and use it to create a Jabber account. Recommend
WinJab
on Windows. Create 2 accounts if you want to converse with your opponent using
Jabber instant messaging during the game (Hex gets very confused if more than one
conversation is going on with the same user name...).
- Download
Ruby.
Recommend
RubyWin
on Windows.
- Download
rjab-connection Jabber connectivity library for Ruby. The SourceForge version
is only available as a Unix .tar file, so here is a
rjab-connection.zip
version for Windows.
.
Run the install.rb file to install it.
- Download
hex.zip.
Unzip it.
- From a windows command prompt in the hex directory, type ruby hex.rb yourUsername yourPassword opponentUsername
- disclaimers: currently the application does not detect victory, must be restarted
after each game, and does not handle network errors gracefully...
- Ruby Hex has been tested on Linux, Windows XP, and Mac OS X (see
Python Hex for OS X details). Have Fun.
Copyright (c) 2002 Eric Rollins
Hex comes with Absolutely No Warranty.
This is free software, and you are welcome to
redistribute it under certain conditions
(for details see:GNU General Public License,
http://www.gnu.org/copyleft/gpl.html)